<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport('joomla.application.component.view');

class ServersViewServer extends JView
{

    /**
     * display method of  view
     * @return void
     **/
    function display($tpl = null)
    {
        $server =& $this->get('Data');
        $isNew = ($server->id < 1);

        $text = $isNew ? JText::_('New') : JText::_('Edit');
        JToolBarHelper::title(JText::_('Servers') . ': <small>[ ' . $text . ' ]</small>');
        JToolBarHelper::save();
        if ($isNew) {
            JToolBarHelper::cancel();
        } else {
            // for existing items the button is renamed `close`
            JToolBarHelper::cancel('cancel', 'Close');
        }

        $this->assignRef('server', $server);

        $model = &$this->getModel();
        $rows = $model->getUserList($server->id);
        $this->assignRef('rows', $rows);

        parent::display($tpl);
    }
}
